<template>
  <m-header></m-header>
  <Tab></Tab>
  <router-view :style="viewStyle" />
  <!-- 命名路由，只对此路由进行处理 -->
  <router-view :style="viewStyle" name="user" v-slot="{ Component }">
    <transition appear name="slide">
      <component :is="Component" />
    </transition>
  </router-view>
  <!-- player组件应用的比较广 -->
  <Player></Player>
</template>
<script>
import Header from '@/components/header/header'
import Tab from '@/components/tab/tab'
import Player from '@/components/player/player'
import { mapState } from 'vuex'
export default {
  components: {
    Player,
    MHeader: Header,
    Tab: Tab
  },
  computed: {
    viewStyle() {
      const bottom = this.playlist.length ? '60px' : '0'
      return {
        bottom
      }
    },
    ...mapState(['playlist'])
  }
}
</script>
<style lang="scss"></style>
